@extends('backstage.layout.master')
@section('title', '被删除用户')
@section('content')
    <style>
        .state li {
            list-style: none;
            float: left;
            padding: 0 20px;
            text-align: center;
            height: 40px;
            line-height: 40px;
        }
        .state ul{
            margin:0;
        }
        .state a{
            font-size: 12px;
        }
        .che a{
            font-weight: bold;
            color:#7c7c7c;
        }
    </style>
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="backstage/user/userlist">用户列表</a>
            </li>
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">
                {{--<span class="input-icon">--}}
                {{--<input type="text" placeholder="搜索..." class="nav-search-input"--}}
                {{--id="nav-search-input" autocomplete="off"/>--}}
                {{--<i class="icon-search nav-search-icon"></i>--}}
                {{--</span>--}}
            </form>
        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        用户
                        <small>
                            <i class="icon-double-angle-right"></i>
                            用户列表
                        </small>
                        <small>
                            <i class="icon-double-angle-right"></i>
                            被删除用户
                        </small>
                    </h1>
                </div>
                <div class="state">
                    <ul>
                        <li><a href="/backstage/user/userlist">全部</a></li>
                        <li><a href="/backstage/user/normaluserlist">正常</a></li>
                        <li class="che"><a href="/backstage/user/deluserlist">被删除</a></li>
                        <li><a href="/backstage/user/banuserlist">被禁用</a></li>
                    </ul>
                </div>
                <div class="table-responsive">

                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">

                        <thead>
                        <tr>
                            {{--<th class="center id">id</th>--}}
                            <th class="center">用户名</th>
                            <th class="center">登录类型</th>
                            <th class="center">状态</th>
                            <th class="center">创建时间</th>
                            <th class="center">更新时间</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($users as $user)
                            <tr>
                                <td hidden="hidden" class="user">
                                    <input class="user_id" type="test" value="{{ $user->user_id}}" style="display: none;">
                                </td>
                                {{--<td class="center">{{ $user->id }}</td>--}}
                                <td class="center">{{ $user->name }}</td>
                                <td class="center">
                                    @if ($user->login_type === 0)
                                        帐号登录
                                    @elseif ($user->login_type == 1)
                                        QQ登录
                                    @elseif ($user->login_type == 2)
                                        微信登录
                                    @elseif ($user->login_type == 3)
                                        新浪微博登录
                                    @endif
                                </td>
                                <td class="center">
                                    @if ($user->state === 0)
                                        被禁用
                                    @elseif ($user->state == 1)
                                        正常
                                    @elseif ($user->state == 2)
                                        已删除
                                    @endif
                                    <input class="state" type="test" value="{{$user->state}}" style="display: none;">
                                <td class="center">
                                    {{ date('Y-m-d H:i:s',$user->created_at) }}
                                </td>
                                <td class="center">
                                    {{ date('Y-m-d H:i:s',$user->updated_at) }}
                                </td>
                                <td class="center">
                                    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                        <a class="userdetail"
                                           onclick="javascript:window.location.href='{{asset('')}}backstage/user/userdetail?user_id={{ $user->user_id}}';"
                                           title="查看用户详情" style="color:#d77600">
                                            <i class="icon-zoom-in bigger-130"></i>
                                        </a>
                                        @if ($user->state == 1)
                                            <a class="red delete"
                                               onclick="javascript:window.location.href='{{asset('')}}backstage/user/delete-user?user_id={{ $user->user_id}}';"
                                               title="删除该用户">
                                                <i class="icon-trash bigger-130"></i>
                                            </a>
                                            <a class="red ban"
                                               onclick="javascript:window.location.href='{{asset('')}}backstage/user/ban-user?user_id={{ $user->user_id}}';"
                                               title="禁用">
                                                <i class="icon-lock bigger-130"></i>
                                            </a>
                                        @endif
                                        @if ($user->state == 2 )
                                            <a class="green reset"
                                               onclick="javascript:window.location.href='{{asset('')}}backstage/user/reset-user?user_id={{ $user->user_id}}';"
                                               title="恢复该用户使用">
                                                <i class="icon-refresh bigger-130"></i>
                                            </a>
                                        @endif
                                        @if ($user->state == 0)
                                            <a class="red delete" title="删除该用户">
                                                <i class="icon-trash bigger-130"></i>
                                            </a>
                                            <a class="recover"
                                               onclick="javascript:window.location.href='{{asset('')}}backstage/user/recover-user?user_id={{ $user->user_id}}';"
                                               title="解除禁用" style="color:#3875d7">
                                                <i class="icon-unlock bigger-130"></i>
                                            </a>
                                        @endif
                                    </div>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    <div class="row">
                        <div class="modal-footer no-margin-top">
                            <div class="dataTables_paginate paging_bootstrap">
                                <?php echo $users->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script type="text/javascript">
        $(function(){
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
        });

    </script>
@stop